package com.cscec5b.inspection.entity;

import jakarta.persistence.*;

@Entity
@Table(name = "user_project")
public class UserProject {

    @EmbeddedId
    private UserProjectId id;

    @Column(name = "project_role", nullable = false, length = 255)
    private String role;

    // === 可选关系：需要时再用，不强制 ===
    // @ManyToOne(fetch = FetchType.LAZY) @MapsId("projectId")
    // @JoinColumn(name = "project_id") private Project project;
    // @ManyToOne(fetch = FetchType.LAZY) @MapsId("userId")
    // @JoinColumn(name = "user_id") private User user;

    public UserProjectId getId() { return id; }
    public void setId(UserProjectId id) { this.id = id; }
    public String getRole() { return role; }
    public void setRole(String role) { this.role = role; }
}
